<?php
include DOCMENT_ROOT.'/Framework/model.class.php';
class indexModel extends model{
   public function __construct(){
       parent::connectMysqlDB("zuoye");
    }
  public function newList($order="add_time desc",$num=5,$start=0){
        $sql = "select * from new order by $order limit $start,$num";//拼接sql语句
        $arr = $this->mysql->select($sql);//查询
        return $arr;//返回结果
    }
    public function newCount(){
        $sql="select count(*) as num from new";   //查询总条数
        $arr = $this->mysql->select($sql);
        $count = 0;
        if(!empty($arr)) {
            $count = $arr[0]["num"];
        }
        return $count;
    }
}